<%@ page import="com.iflytek.management.pojo.SysUser" %><%--
  Created by IntelliJ IDEA.
  User: computer
  Date: 2021/6/6
  Time: 14:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<h1 align="center" style="color: #1a54e8">编辑个人资料</h1>
<% String path = request.getContextPath();
   String basepath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;%>
<%SysUser user = (SysUser) session.getAttribute("user");%>
<%SysUser userd = (SysUser) session.getAttribute("userd");%>
<table class="edituser">
    <tr>
        <td style="padding: 10px 30px">
            <table class="pic">
                <tr>
                    <td style="width: 60px;"><span style="margin: auto 20px">头像:</span></td>
                    <td><img id="headimg" src="${userd.pic==null?"/management/static/image/admin.png":userd.pic}" alt="" style="width: 100px; height: 100px"></td>
                </tr>
            </table>
        </td>
        <td>
            <div class="sx"></div>
        </td>
        <td style="padding: 10px 30px">
            <table class="update">
                <tr>
                    <td><span class="star">*</span>姓名</td>
                    <td><input id="name" type="text" name="name"
                               value="${userd.name }"></td>
                </tr>
                <tr>
                    <td><span class="star">*</span>Email</td>
                    <td><input id="email" type="text" name="email"
                               value="${userd.email}"></td>
                </tr>
                <tr>
                    <td><span class="star">*</span>手机号</td>
                    <td><input id="phone" type="text" name="phone"
                               value="${userd.phone}"></td>
                </tr>

                <%if(userd.getRoleid().equals("1") || user.getRoleid().equals("1")){%>
                <tr>
                    <td><span class="star">*</span>角色</td>
                    <td><select name="select" id="roleid">
                        <option value="1" ${userd.roleid == '1'?"selected":""}>管理员</option>
                        <option value="2" ${userd.roleid == '2'?"selected":""}>项目经理</option>
                        <option value="3" ${userd.roleid == '3'?"selected":""}>普通员工</option>
                    </select>
                    </td>
                </tr>
                <%}%>
                <tr>
                    <td></td>
                    <td><span id="updateresult1" style="color: red"></span></td>
                </tr>
                <tr>
                    <td colspan="2" style="text-align: center"><button style="color: white;background-color: #1a54e8" onclick="updateUser(${userd.userid}, ${user.roleid})">提交修改</button></td>
                </tr>
            </table>
        </td>
    </tr>
</table>